<div style="padding:30px" class="layui-form layui-form-pane">
    <input type="hidden" id="id" value="{$data.id}">
    <div class="layui-form-item">
        <label class="layui-form-label">所属分类：</label>
        <div class="layui-input-block">
            <select name="parent_id" id="parent_id" lay-verify="required" lay-search>
                <option value="0" {eq name="$data.parent_id" value="0"}selected{/eq}>顶级分类</option>
                {foreach $parent as $key=>$vo}
                    <option value="{$vo.id}" {eq name="$data.parent_id" value="$vo.id"}selected{/eq}>{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属类型：</label>
        <div class="layui-input-block">
            <select name="type_id" id="type_id" lay-verify="required" lay-search>
                <option value="0" {eq name="$data.type_id" value="0"}selected{/eq}>通用类型</option>
                {foreach $type as $key=>$vo}
                    <option value="{$vo.id}" {eq name="$data.type_id" value="$vo.id"}selected{/eq}>{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类名称：</label>
        <div class="layui-input-block">
            <input type="text" name="name" id="name" required lay-verify="required" placeholder="请输入分类名称" autocomplete="off" class="layui-input" value="{$data.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">分类图标：</label>
        <div class="layui-input-block">
            {Jshop:image id='image_id' name="image_id" value="$data['image_id']"/}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序：</label>
        <div class="layui-input-block">
            <input type="number" name="sort" id="sort" required lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input" value="{$data.sort}">
        </div>
    </div>
    <button class="layui-btn layui-btn-fluid edit-save-btn">保存</button>
</div>

<script>
    //渲染表单
    layui.use('form', function(){
        var form = layui.form;
        form.render();
    });
</script>